import { initializeApp } from 'firebase/app'
import { getDatabase } from 'firebase/database'
import { getFirestore } from 'firebase/firestore'
import { getStorage } from 'firebase/storage'

// const config =
// 	import.meta.env.MODE === 'development'
// 		? JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG)
// 		: JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG_PUBLIC)
const config = {
  // AIzaSyBtnfBxW3wZnOe1FJ6p3lyihbKwI_vxQpA
  apiKey: 'AIzaSyBtnfBxW3wZnOe1FJ6p3lyihbKwI_vxQpA',
  authDomain: 'i2finance-sra.firebaseapp.com',
  projectId: 'i2finance-sra',
  storageBucket: 'i2finance-sra.appspot.com',
  messagingSenderId: '345007822950',
  appId: '1:345007822950:web:d323c5a4d1ffb46590f5a7',
  measurementId: 'G-MJYVGEPT45'
}

initializeApp(config)

export const firestoreDb = getFirestore()
export const realtimeDb = getDatabase()
export const storage = getStorage()
